<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:102:"D:\phpStudy2018\PHPTutorial\WWW\xbs22\supermarket\public/../application/index\view\reap_ress\test.html";i:1540119770;s:84:"D:\phpStudy2018\PHPTutorial\WWW\xbs22\supermarket\application\index\view\layout.html";i:1539950400;}*/ ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>超市 </title>
	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta name="renderer" content="webkit">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="icon" type="image/png" href="/static/images/favicon.png">
	<link href="/static/css/amazeui.min.css" rel="stylesheet" type="text/css" />
	<link href="/static/css/style.css" rel="stylesheet" type="text/css" />
	<script src="/static/js/jquery-1.10.2.min.js"></script>
	<script src="/static/js/time.js"></script>
	<script src="/static/js/popup.mini.js"></script>
	<link rel="stylesheet" href="/static/layui/css/layui.css" />
	<script src="/static/layui/layui.js"></script>
</head>
<body style="background: #f6f6f6;">

<link rel="stylesheet" type="text/css" href="http://www.jq22.com/demo/cityPicker201707132212/css/index.css">
<div class="container">
	<h3>模拟城市-不自动选择第一项/无搜索/四级城市</h3>
	<div class="dome-main">
		<div class="city-picker-selector" id="city-picker-selector1"></div>
		<div class="btn-cont">
			<button class="btn btn-setcity">设置城市</button>
			<button class="btn btn-bg-1 btn-obtain">获取城市</button>
			<button class="btn btn-bg-2 btn-prohibit">禁止状态</button>
			<button class="btn btn-bg-3 btn-current">可用状态</button>
		</div>
		<div class="code">
			<a href="javascript:;" class="show-code">code</a>
			<pre><code>var selector1 = $('#city-picker-selector1').cityPicker({
					dataJson: cityData,
					renderMode: true,
					search: false,
					autoSelected: false,
					code: 'cityCode',
					level: 4,
					onChoiceEnd: function() {
						console.log(this.values)
					}
				});

				// 设置城市
				selector1.setCityVal('广东省, 广州市, 天河区, 天园街道');

				// 省份选择的回调
				$('#city-picker-selector1').on('choose-province.citypicker', function(event, tagert, values) {
					console.log(values);
				});

				// 城市选择的回调
				$('#city-picker-selector1').on('choose-city.citypicker', function(event, tagert, values) {
					console.log(values);
				});

				// 区县选择的回调
				$('#city-picker-selector1').on('choose-district.citypicker', function(event, tagert, values) {
					console.log(values);
				});

				// 街道选择的回调
				$('#city-picker-selector1').on('choose-street.citypicker', function(event, tagert, values) {
					console.log(values);
				});</code></pre>
		</div>
	</div>
	<h3>模拟城市-自动选择第一项/无搜索/三级城市</h3>
	<div class="dome-main">
		<div class="city-picker-selector" id="city-picker-selector2"></div>
		<div class="code">
			<a href="javascript:;" class="show-code">code</a>
			<pre><code>var selector2 = $('#city-picker-selector2').cityPicker({
					dataJson: cityData,
					renderMode: true,
					search: false,
					autoSelected: true,
					code: 'cityCode',
					level: 3,
					onChoiceEnd: function() {
						console.log(this.values)
					}
				});

				// 设置城市
				selector2.setCityVal('广东省, 广州市, 天河区');</code></pre>
		</div>
	</div>
</div>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="https://lquan529.github.io/cityPicker/js/citydata.min.js"></script>
<script type="text/javascript" src="js/cityPicker-2.0.3.js"></script>
<script type="text/javascript">
    $(function () {
        // 显示代码
        $('.show-code').on('click', function (event) {
            var $this = $(this);

            $this.next('pre').slideToggle(500);
        });

        // 模拟城市-无联动/无搜索
        var selector1 = $('#city-picker-selector1').cityPicker({
            dataJson: cityData,
            renderMode: true,
            search: false,
            storage: false,
            autoSelected: false,
            shorthand: true,
            code: 'cityCode',
            level: 4,
            onChoiceEnd: function() {
                console.log(this.values)
            }
        });

        // 设置城市
        selector1.setCityVal('广东省, 广州市, 天河区, 天园街道');

        $('.btn-setcity').on('click', function (event) {
            selector1.setCityVal('广东省, 深圳市, 罗湖区, 桂园街道');
        });

        // 获取城市值
        $('.btn-obtain').on('click', function (event) {
            alert(JSON.stringify(selector1.getCityVal()));
        });

        $('.btn-prohibit').on('click', function (event) {
            selector1.changeStatus('disabled');
        });

        $('.btn-current').on('click', function (event) {
            selector1.changeStatus('current');
        });

        // 模拟城市-无联动/无搜索
        var selector2 = $('#city-picker-selector2').cityPicker({
            dataJson: cityData,
            renderMode: true,
            search: false,
            autoSelected: true,
            code: 'cityCode',
            level: 3,
            onChoiceEnd: function() {
                console.log(this.values)
            }
        });

        // 设置城市
        selector2.setCityVal('广东省, 广州市, 天河区');
    });
</script>

<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/amazeui.min.js"></script>
</body>
</html>